package com.stlm2.dems.entity;

/**
 * Author：fuchunyu
 * Date：2017/10/13
 * Description：
 */
public enum CardsState {
    Unused(0) {
        public String toString() {
            return "未使用";
        }
    },
    Used(1) {
        public String toString() {
            return "已使用";
        }
    },
    Due(2) {
        public String toString() {
            return "已过期";
        }
    };

    private final int val;

    CardsState(int n) {
        val = n;
    }

    public int getIntValue() {
        return val;
    }

    public static CardsState getByIntValue(int n) {
        switch (n) {
            case 0:
                return Unused;
            case 1:
                return Used;
            case 2:
                return Due;
            default:
                return null;
        }
    }
}
